list = [1,2,3,4]
#insert
list.insert(1,'new')
print(list)
#append
list = [1,2,3,4]
list.append('new')
print(list)

#count
list = [1,2,3,4,1,2,3,444,444,444]
num = list.count(1)
print(list)
print(set(list))

#remove

print(list)
list.remove(1)
print(list)

#reverse

list.reverse()
print(list)

#sort
list = [{'name':'yulidong','age':'24','gender':'man'},{'name':'zhansan','age':'25','gender':'woman'},
        {'name':'lisi','age':'34','gender':'man'},{'name':'waner','age':'29','gender':'man'}
        ,{'name':'guanhu','age':'54','gender':'man'}]
print(list)
list.sort(key=lambda x:x['age'],reverse=True)
print(list)

#clear

list.clear()

print(list)

#copy
list = [{'name':'yulidong','age':'24','gender':'man'},{'name':'zhansan','age':'25','gender':'woman'},
        {'name':'lisi','age':'34','gender':'man'},{'name':'waner','age':'29','gender':'man'}
        ,{'name':'guanhu','age':'54','gender':'man'}]
print(id(list))
listb = list.copy()
print(id(listb))

#extend

list = [1,2,3]
listb = (4,5,6)
list.extend(listb)
print(list)

#切片

print(list[2::])
print(list[:3:])
print(list[::2])
print(list[::-1])

#del

del list
print(list)

